import json
def dict2json(variable_name):
    jsObj = json.dumps(variable_name)
    fileObject = open(f'{variable_name}.json', 'w')
    fileObject.write(jsObj)
    fileObject.close()